package ttOrder.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ttOrder.dao.TableDAOImpl;
import ttOrder.model.DinnerTable;

@Service
@Transactional
public class TableServiceImpl implements ITableService {
	@Autowired
	private TableDAOImpl tabledao;

	@Override
	public List<DinnerTable> findAllTable() {
		return	tabledao.findAllTable();
	}

	@Override
	public DinnerTable getTableById(Integer id) {
		return	tabledao.getTableById(id);
	}

	@Override
	public void createTable(DinnerTable table) throws Exception {
		// TODO Auto-generated method stub
		 tabledao.createTable(table);
	}

	@Override
	public void editTable(Integer id) throws Exception {
		// TODO Auto-generated method stub
		tabledao.editTable(id);;
	}

	@Override
	public Integer deleteTable(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return tabledao.deleteTable(id);
	}
}
